home *** CD-ROM | disk | FTP | other *** search
- -------------------------------------------------------------------
- FORTUNE Version 4.10
- -------------------------------------------------------------------
-
- Copyright (c) 1986,1987 by Christopher D. Orr. All rights reserved.
-
-
-
- FORTUNE VERSION 4.10 is currently distributed as User Supported
- Software. With a few restrictions, this allows the
- program, although copyrighted, to be freely copied and
- distributed.
-
- This product must be copied and distributed as a complete
- package. This includes the FORTUNE 4.10 program (FORTUNE.COM),
- this documentation file (FORTUNE.DOC), (BYE.LNS), (FORTCONV.COM),
- and (FORTCONV.DOC). FORTUNE 4.10 is copyrighted and may not be
- distributed if altered or modified in any way (with the exception
- of the BYE.LNS file - you may add fortunes, but please don't delete
- any.) Finally, no fee is to be charged for copying or distributing
- the programs without my written permission.
-
- In short, FORTUNE 4.10 may be copied and distributed to
- anyone who wishes it as long as it is a complete unmodified
- package including the program and documentation and no fee
- is charged.
-
-
- Christopher D. Orr
- 1907 Willow Park Rd.
- Bethlehem, PA 18017
-
-
-
- REQUIRED CONFIGURATION
-
- * Any MS-DOS computer
- * DOS 2.0 or above
-
-
-
- COMMAND LINE SYNTAX
-
- [C:\] FORTUNE {-acdfnprs{l}##} {your_name}
-
-
-
- INSTALLING FORTUNE 4.10
- -----------------------
-
- Floppy Disk Users:
- Place FORTUNE on your DOS disk for use. Whenever you want to use FORTUNE,
- you will use it from your DOS disk. Additionally, place the following line in
- your AUTOEXEC.BAT file:
- SET NAME=your_name
- where your_name if the name you would like to addressed as. The maximum length
- your name can be is 50 characters.
-
-
- Hard Disk Users:
- FORTUNE and its data files can be stored in any directory. If the directory
- name is included in the path definition, FORTUNE will find its data files.
- Addionally, place the following line in your AUTOEXEC.BAT file:
- SET NAME=your_name
- where your_name if the name you would like to addressed as. The maximum length
- your name can be is 50 characters.
- You may also want to use the MORE_BYE.LNS file supplied with FORTUNE. To
- do this you will need a line saying:
- SET LINES=c:\fortune\bye.lns;c:\fortune\more_bye.lns
- This will tell fortune to get its fortunes from both files.
-
-
- What Data File should I Use?
- ----------------------------
- By using the enviroment variable LINES, you can tell fortune where to
- find the BYE.LNS file. If you want to use a different name (other than
- BYE.LNS), you can specify that here too. For example, if you keep the BYE.LNS
- file in your UTILS directory, the command would be
- SET LINES=C:\UTILS\BYE.LNS
- If you omit the directory the file is in, Fortune will search the path to
- try and find the file.
-
-
- Using FORTUNE is AUTOEXEC.BAT files:
- ------------------------------------
- Many of you may wish to use FORTUNE as the last line of your autoexec
- file. The key here is to put FORTUNE in after you have set the time and date.
- The reason for doing this is because fortune uses the time and date to generate
- its random number.
-
-
-
- SWITCHES
-
- The command line is of the form FORTUNE {-acdfnprs##} {your_name}. The
- switches recognized by FORTUNE are discussed below:
-
- a - Ansi Graphics
- This switch tells fortune to use the ANSI graphics device driver
- instead of interupt calls to change the screen colors, clear the screen,
- etc.
-
- b - BBS Style Output. Greeting is "QUOTE OF THE DAY" followed by a quote.
- This makes Ansi default on, Clear Screen default Off, and Tell default
- to off. Redirect output to capture to your news file.
-
- c - Clean the Sreen before displaying fortune (default).
-
- d - Change Separator Character.
- This switch will allow you to change the default separator char
- in the BYE.LNS file. The default character is the Null char (^@),
- Ascii code 0. You can use the switch in 2 ways.
- /d{char} or /d{ascii code}
- So, to use the Null Character, you would type /d0 or /d^@.
- (Obviously, the ^@ can't be typed in DOS, so you would have to use the
- ascii code in this case). See the program FORTCONV to convert FORTUNE's
- asscociated BYE.LNS file if you would like to use this option.
- If you have a file separated by a blank line, use the switch /d13.
- This will tell fortune to correctly read that file.
- This switch can ONLY be set through the environment variable
- FORTUNE (see below). There is a safeguard built into the switch so if
- you do specify a separator character that doesn't appear, FORTUNE will
- eventually abort.
-
- f - Use a different BYE.LNS file
- For those of you who would prefer to use a filename other than
- BYE.LNS, you can do so with this command line switch. This can also
- be accomplished using the enviroment variable LINES (e.g. Use the
- command SET LINES={filespec}). You can specify Fortune to use more than
- one Bye.Lns file by separating each one with a semi-colon.
- (NOTE: if the -d parameter is used, all files must be on the same type!)
- If you do specify more that one BYE.LNS file, they should all be of
- approx. equal size. To add code to check the # of fortunes in each
- file and choose the file to use based on that would take too long when
- giving a fortune.
-
- h - Turn off Greeting switch to prevent greeting message. This switch
- toggles so first occurance turns it off, the next on, etc.
-
- i - Use an index file. See below.
-
- n - Don't clear the screen
- This switch will prevent the screen from clearing. This might be
- necessary on some MS-DOS machines.
-
- p - Current Position in BYE.LNS file(s).
-
- r - Continual Fortune
- This switch will cause FORTUNE to continue giving you fortunes with
- about a five second delay between them. Hitting any key will cause
- FORTUNE to terminate.
-
- s - So Long Message
- If you have some sort of logging out routine, this might be a nice
- touch to add to it.
-
- sl- So Long Message and Lock up System
- If you have some sort of standard logout routine, you might want to
- use this option so that the user WILL have to reboot his system.
-
- t - Instructs FORTUNE to tell you, when printing the fortune, which
- Bye.Lns file the fortune came from. Useful only if you are using more
- than one Bye.Lns file (Like I do).
-
- u - Don't Use an Index File. See Below.
-
- # - Changes color of text
- This switch will cause FORTUNE to display your fortune in some other
- color. Enter the number of the color you want.
-
-
- Your_Name field is simply your name. This field can be omitted if the
- environment variable NAME is set to your name. FORTUNE will use the command
- line value of your name before it uses the environment value. Additionally,
- if you would like to specify your name on the command line and you want to
- use multiple words, you must surround your name by quotation marks. This is
- not necessary when using the Environment variable NAME. The maximum length
- your name can be is 50 characters.
-
- Creating Default Switches
- -------------------------
-
- Once you determine the command line switches you like to use, you can set
- the Environment variable FORTUNE to those command line switches. So, lets
- say you don't like fortune to clear your screen and you like the color 3.
- Use the command SET FORTUNE=/n/3 to set these up as defaults. As with all
- other environment, these settings can be overridden on the command line.
-
-
- Using an Index File
- -------------------
- FORTUNE, by default, creates an index file for your Bye.Lns file. This
- index file is used to create truly random fortunes. Optionally, using the
- -u switch you can prevent this use of an index file. The trade off is disk
- space vs. randomness. If you use an index file, you are limited to 2500
- fortunes per Bye.Lns file. This equates to a Bye.Lns file size of approx.
- 200k. The current size is 80k. If you do find that you have a file larger
- than this, simply split it into two files and use the environment variable
- LINES to specify the two file names (see above). Each Index file takes up
- 7k worth of disk space.
-
-
- GETTING HELP
-
- Help can be gotten on the command line by entering FORTUNE ? <return>.
-
-
- SUMMARY OF CHANGES:
- (there have been quite a few!)
-
- 1.00 Original version of FORTUNE
-
- 2.00 Allowed the bye lines file to be any size and added proper parameter
- parsing.
-
- 2.10 In house version.
-
- 2.20 Fixed the random number generator to give a number much closer to
- a true random number.
-
- 3.00 It seems that Turbo Pascal's random number generator uses the clock
- in such a way that any number which you seed it with makes no
- difference on boot. That is because the clock has only ticked so
- many cycles I believe. In any event, I implemented my own random
- number generator along with Borland's to give a good number on boot!
-
- 3.01 Fixed minor bug for Early morning risers: message was scewed up ...
- Hell, I never get up THAT early!
-
- 3.10 Seems that the number generator was still having problems in certain
- cases. It has been changed to "walk" through the fortune file. This
- technique should give much better numbers.
-
- 3.20 Added ANSI graphics support and an option to lock up the system after
- saying SO-LONG.
-
- 3.21 Added /p option to see position in BYE.LNS file. Useful to track how
- random fortune is. NOTE: Fortune uses a stepping routine to step
- through the BYE.LNS file so be aware of this when looking at the
- number.
-
- 3.22 Corrected /r option so that BYE.LNS position is updated at the
- end of the repeat. Makes for better repeating randomness.
-
- 3.30 - Fixed problem with Path definition being longer than 80 characters.
- It is now set to 255 characters (the DOS limit).
- - Added Environment Variable LINES to specify a file other than the
- default BYE.LNS file. Also added command line switch -F to override
- the same default file.
- - Added Environment Variable FORTUNE to allow setting of default
- values. Also added command line switch -c to clear the screen (to be
- used to override the no clear screen option set with FORTUNE=).
- - Added On-line help information.
-
- 3.40 - Added /D option allow changing of separator character in BYE.LNS file.
- See above documentation before attempting to use this feature!
- - Fortune Now comes with a utility called FORTCONV.COM. This utility
- will take a files of bye lines, each one separated by a blank line,
- and convert them to Fortune's standard format (each on separated by
- a Null Character (^@). See its associated documentation for complete
- details.
- - Added multiple file capability. Set your environment variable
- LINES to all the files you have fortunes in. Seperate each one with
- a semicolon (;).
-
- 4.00 - In-House version. Never released.
- 4.01 - In-House version. Never released.
-
- 4.02 - Added Indexing Capabilities. This means that all fortunes have an
- equal weight. Previously, Fortune choose a random place in the file
- and printed that Fortune. This resulted in some fortunes being
- displayed more than others. The trade off is disk space. For each
- Fortune File, using the indexing method, you must give up 7k. Overall,
- this is a very small price to pay for the quality of the fortune you
- get. If you would like to use the old method, use the -u switch to
- prevent use of the index file. The -i switch turns the indexing
- option on (default).
- - Optimized the Code a little more
- - Worked on the Random Number Generator again (last time).
- - Returns ErrorLevel depending on function. An information function
- (such as help) returns ErrorLevel 2, an error returns ErrorLevel 1 and
- a normal termination is ErrorLevel 0.
- - Modified -p switch to give more information about the Bye.Lns file.
- - added a help message when using the -r switch.
- 4.03 - Added the ability to turn of the Greeting message. This switch is a
- toggling switch. (e.g. to turn the greeting off, use -h. Another
- occurance of it turns the greeting back on)
- - Added BBS mode where Fortune will tell print the fortune without
- clearing the screen and in ANSI mode. It will also print a more
- appropriate message.
- 4.04 - FORTUNE now looks at the day of the week to and adjusts some of its
- messages accordingly.
- 4.05 - Made fortune print <TABS> as spaces. Bye.Lns can now contain tabs.
- 4.06 - Added -T switch to cause fortune to tell you which BYE.LNS file
- your fortune is coming from (Useful if you use more than one like I do)
- 4.07 - Had a problem with switches entered like: /r/n - note that there is no
- space between. Fortune now will parse this correctly.
- - Fixed problem when specifying /r/n: The message was slighty messy.
- - Also adjusted greeting message to be "more timely".
- - /p parameter now reports on all accessable BYE.LNS file(s).
- 4.08 - Fixed FORTUNE to allow more than one parameter in FORTUNE environment
- variable. It also allows you to put your name is this variable.
- Therefor, you could combine all the environment variables into this
- single one.
- 4.09 - Changed Fortune to allow you to use a multiple word name on the
- command line. Do this by surrounding the name by quotes. NOTE: Quotes
- are not allowed in your name. The maximum length of your name has
- been increased from 20 characters to 50 characters.
- 4.10 - Fixed bug when you used quotes in variable FORTUNE. This has now been
- made illegal. If your name is multiple wods you must use NAME=.
-
- Future Versions:
-
- I hope to add some data compression algorithms to cut down on the size of
- the Bye.Lns files(s). Mine is now over 300k long. A good compression would
- cute that size down to 140k at the most.
- And who knows what else ....
-